package com.peng.pojo;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Time;
import java.util.Objects;

@Table(name = "tb_open_course", schema = "springboot-tuofu", catalog = "")
public class OpenCourse implements Serializable {
    private int id;
    private String title;
    private Date classTime;
    private Time startTime;
    private Time endTime;
    private String suitableStudents;
    private String picture;
    private String courseArrangement;
    private String classWay;
    private String lectureGuide;
    private Double consumptionToefl;
    private Integer status;
    private String name;
    private User user;
    private ArticleType articleType;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public ArticleType getCourseType() {
        return articleType;
    }

    public void setCourseType(ArticleType articleType) {
        this.articleType = articleType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "class_time")
    public Date getClassTime() {
        return classTime;
    }

    public void setClassTime(Date classTime) {
        this.classTime = classTime;
    }

    @Basic
    @Column(name = "start_time")
    public Time getStartTime() {
        return startTime;
    }

    public void setStartTime(Time startTime) {
        this.startTime = startTime;
    }

    @Basic
    @Column(name = "end_time")
    public Time getEndTime() {
        return endTime;
    }

    public void setEndTime(Time endTime) {
        this.endTime = endTime;
    }

    @Basic
    @Column(name = "suitable_students")
    public String getSuitableStudents() {
        return suitableStudents;
    }

    public void setSuitableStudents(String suitableStudents) {
        this.suitableStudents = suitableStudents;
    }

    @Basic
    @Column(name = "picture")
    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    @Basic
    @Column(name = "course_arrangement")
    public String getCourseArrangement() {
        return courseArrangement;
    }

    public void setCourseArrangement(String courseArrangement) {
        this.courseArrangement = courseArrangement;
    }

    @Basic
    @Column(name = "class_way")
    public String getClassWay() {
        return classWay;
    }

    public void setClassWay(String classWay) {
        this.classWay = classWay;
    }

    @Basic
    @Column(name = "Lecture_guide")
    public String getLectureGuide() {
        return lectureGuide;
    }

    public void setLectureGuide(String lectureGuide) {
        this.lectureGuide = lectureGuide;
    }

    @Basic
    @Column(name = "consumption_toefl")
    public Double getConsumptionToefl() {
        return consumptionToefl;
    }

    public void setConsumptionToefl(Double consumptionToefl) {
        this.consumptionToefl = consumptionToefl;
    }

    @Basic
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OpenCourse that = (OpenCourse) o;
        return id == that.id &&
                Objects.equals(title, that.title) &&
                Objects.equals(classTime, that.classTime) &&
                Objects.equals(startTime, that.startTime) &&
                Objects.equals(endTime, that.endTime) &&
                Objects.equals(suitableStudents, that.suitableStudents) &&
                Objects.equals(picture, that.picture) &&
                Objects.equals(courseArrangement, that.courseArrangement) &&
                Objects.equals(classWay, that.classWay) &&
                Objects.equals(lectureGuide, that.lectureGuide) &&
                Objects.equals(consumptionToefl, that.consumptionToefl) &&
                Objects.equals(status, that.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, title, classTime, startTime, endTime, suitableStudents, picture, courseArrangement, classWay, lectureGuide, consumptionToefl, status);
    }
}
